<%-- 
    Document   : ReservationVehicule
    Created on : 25 nov. 2013, 12:16:17
    Author     : Yohan
--%>

<%@page import="Com.agenceLocation.bdd.Vehicule"%>
<%@page import="Com.agenceLocation.bdd.Client"%>
<%@page import="javax.persistence.Query"%>
<%@page import="Com.agenceLocation.bdd.Entity"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Agence location</title>
          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
        <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
        <link rel="stylesheet" href="css/le-frog/jquery-ui-1.10.3.custom.css" />
          <link rel="stylesheet" type="text/css" href="Content/CSS/demo.css" />
        <link rel="stylesheet" type="text/css" href="Content/CSS/style.css" />
        <link rel="stylesheet" type="text/css" href="Content/CSS/animate-custom.css" />
        <link rel="stylesheet" type="text/css" href="Content/CSS/styleForm.css" />
    <script type="text/javascript">
        $(document).ready(function(){
            
        $("#dateDebut").datepicker();
        
        $("#dateFin").datepicker();
        });
    </script>
    </head>
    <body>
    <center>
        <div id="header">
            <img src="Content/CSS/images/LogoAgence3.png">               
        </div>     
        <div class="wrapperMenu" style="color:white;display: inline-block;">           
            <ul id="menu_horizontal" class="menu">
                <li><a href="HomePage.html">Accueil</a></li>
                <li class="active"><a href="ReservationVehicule.jsp">Reserver un Véhicule</a></li>
                <li><a href="RetourVehicule.jsp">Retourner un Véhicule</a></li>
                <li><a href="NewClient.jsp">Enregistrer un Client</a></li>
                <li><a href="Connexion.jsp">Connexion</a></li>
            </ul>            
        </div>
    </center>         
        <div id="wrapper">
            <div id="register">
            <center>   
              <form  action="ReservationVehicule.java" method="POST"> 
                <h1>Réservation véhicule</h1> 
                 <p> 
                    <label for="listeClients" class="youclient">Liste Clients</label>
                    <select id="listeClients" name="listeClients" required="required"/>
                        <option value="0">Sélectonner un client ...</option>
                        <%
                            Query q = Entity.GetInstance().createQuery("SELECT c FROM TEST.CLIENT c");
                            List<Client> listCli = q.getResultList();
                            int i=1;
                            for(Client c : listCli){
                                //Affichage client
                                out.print("<option value=\"" + i++ + "\">" + c.getName() +"</option>");
                            }
                        %>
                    </select>
                </p>
                 <p> 
                    <label for="idVehicule" class="youvehicule">Véhicule</label>
                    <select id="idVehicule" name="idVehicule" required="required"/>
                        <option value="0">Sélectonner un véhicule ...</option>
                        <%
                            q = Entity.GetInstance().createQuery("SELECT v FROM TEST.VEHICULE v");
                            List<Vehicule> listVehicule = q.getResultList();
                            i=1;
                            for(Vehicule v : listVehicule){
                                //Affichage vehicule
                                out.print("<option value=\"" + i++ + "\">" + v.getName() +"</option>");
                            }
                        %>
                    </select>
                </p>                
                <p> 
                    <label for="dateDebut" class="youdateDebut">Date début</label>
                    <input id="dateDebut" name="dateDebut" required="required"/>
                </p>
                 <p> 
                    <label for="dateFin" class="youdateFin">Date fin</label>
                    <input id="dateFin" name="dateFin" required="required"/>
                </p>
                 <p> 
                    <label for="prix" class="youprix">Prix</label>
                   <input id="prix" name="prix" required="required" type="text" />                
                </p> 
                 <p> 
                    <label for="ecoTaxe" class="youprix">EcoTaxe</label>
                   <input id="ecoTaxe" name="ecoTaxe" required="required" type="text" />                
                </p> 
                 <p> 
                    <label for="listeEntreprises" class="youvehicule">Faire un don</label>
                    <select id="listeEntreprises" name="listeEntreprises" required="required"/>
                        <option value="0">Choisir une entreprise...</option>
                        <option value="1">Green Peace</option>
                        <option value="2">WWF</option>
                        <option value="3">Dervenn</option>
                    </select>
                </p>  
                <p class="signin button"> 
                    <input type="submit" value="Enregistrer"/> 
               
                </p>                              
            </form>  
                
                
         <!--       
        <form method="post" action="ReservationVehicule.java">
           <table>
                <tr>
                    <td>Client : </td>
                    <td>
                        <select name="listeClients" id="listeClients" > 
                            <option value="0">Sélectonner un client ...</option>
                            
                           //REMETRE 
                                Query q = Entity.GetInstance().createQuery("SELECT c FROM Client c");
                                List<Client> listCli = q.getResultList();
                                int i=1;
                                for(Client c : listCli){
                                    //affichage client
                                    out.print("<option value=\"" + i++ + "\">" + c.getName() +"</option>");
                                }
                            %>
                        </select> 
                    </td>
                </tr>
                <tr>
                    <td>Véhicule : </td>
                    <td>
                        <select name="listeVehicules" id="listeVehicules" > 
                            <option value="0">Sélectonner un véhicule ...</option> 
                        </select> 
                    </td>
                </tr>
                <tr>
                    <td>Date début : </td>
                    <td><input type="date" name="dateDebut"/></td>
                    <td>Date fin : </td>
                    <td><input type="date" name="dateFin"/></td>
                </tr>
                <tr>
                    <td>Prix : </td>
                    <td><input type="text" name="dateDebut"/></td>
                </tr>
                <tr>
                    <td>EcoTaxe : </td>
                    <td> <input type="text" name="ecoTaxe"/> €</td>
                    <td>Faire un don : </td>
                    <td><select name="listeEntreprises" id="listeEntreprises" > 
                    <option value="0">Sélectonner une entreprise ...</option> 
                </select> </td>
                </tr>
            </table>
            <div>
                <input type="submit" name="valider" value="Valider"/>
                <input type="reset" name="reset" value="Réinitialiser"/>
                <input type="button" name="annuler" value="Annuler"/>
            </div>
        </form>
         -->
         
         
    </center>
    </body>
</html>
